package com.yuwei.main.demo

import androidx.lifecycle.viewModelScope
import com.yuwei.common.mvi.BaseViewModel
import kotlinx.coroutines.launch

class DemoViewModel: BaseViewModel<DemoApiService, DemoIntent>() {
    override fun handleIntent(intent: DemoIntent) {
        viewModelScope.launch {
            when(intent){
                is DemoIntent.getGoodsCategory ->{
                    httpRequest(apiService.getGoodsCategory(),"getGoodsCategory")
                }
            }
        }
    }
}